package interface2;

import interface1.A;

public class Test {
    public static void main(String[] args) {
        //目标：理解设计接口的好处，用处。
        //接口弥补了类只能单继承的问题，允许多继承，类的功能更丰富。
        Person p = new Student();
        Driver d = new Student();//多态
        Friend f = new Student();

        //接口可以实现面向接口编程，更利于 解耦合。
        Driver d1 = new Teacher();
        Friend f1 = new Student();
    }
}


interface Driver{}
interface Friend{}
class Person{}
class Student extends Person implements Driver, Friend{}
class Teacher  implements Driver ,Friend {}